package com.bdd.controller;

import com.bdd.Result.Result;
import com.bdd.model.bo.UserBO;
import com.bdd.service.RoleService;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/role")
public class RoleController {

    @Autowired
    RoleService roleService;

    @PostMapping("/list")
    @RequiresRoles({"ADMIN"})
    public Result<List<String>> list() {
       List<String> nameList = roleService.list();
        return Result.ok(nameList);
    }
}
